#ifndef __LIST_H__
#define __LIST_H__

#include "Iterator.h"
#include "ListException.h"

namespace cs236703_spring2012_hw2
{

// The List class is the linked list container. Most of the
// actual operations are done using an iterator.
class List
{
public:
	// What would happen if the d'tor is not virtual?
	virtual ~List() {}
	// Get an iterator, pointing on the location before the first node.
	// Note: must be freed when not needed anymore!
	virtual Iterator* GetIterator() = 0;
	// Get the content version. The version is updated on every addition or delete.
	virtual int GetVersion() const = 0;
	// Add a new element at the beginning of the list
	virtual void AddToFront(int i, bool immutable = true) = 0;
	// Add a new element at the end of the list
	virtual void AddToBack(int i, bool immutable = true) = 0;
};

// Return an instance of the list implementation.
// This way, Main.cpp can include List.h, and not the implementation header.
// The function should be defined in any of the cpp files, and just return
// a new instance of the list implementation.
// Node: allocated list must be freed by the caller.
List* GetNewList();

}
#endif
